import { defineConfig } from 'vite'
import { resolve } from 'path'

// https://vitejs.dev/config/
export default defineConfig({
  build: {
    target: 'es2020',
    outDir: './dist',
    lib: {
      entry: resolve(__dirname, 'src/index.ts'),
      fileName: 'pt',
      formats: ['cjs', 'es'],
    },
    emptyOutDir: true,
    assetsInlineLimit: 100000000,
    rollupOptions: {
      external: ['three', 'lodash'],
    },
  },
})
